-- absorb
-- created by zhuangsl
-- 吸能术

return {
    fetchProps = function(who, status, condition)
        local props  = {};
        local propId = PropM.getPropId("absorb");
        local value  = tonumber(condition["value"]);
        local endRound = condition["end_round"];
        
        if value > 0 then
            table.insert(props, { propId, 1, value, endRound, });
        end

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 天赋额外效果
        local prop = PropM.combine(who, "magic_revive", 53);
        local mp = PropM.apply(prop, 1000);
        if mp > 0 then
            desc = cfg.extra_desc;
            desc = string.gsub(desc, "{append}", mp);
        end

        -- 效果，百分比
        local value = condition["value"];
        value = math.modf(value / 10);
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
